<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="/resource/css/admin/main.css" type="text/css" rel="stylesheet" />
<link href="/resource/css/admin/right.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/resource/js/jquery.js"></script>
<script type="text/javascript" src="/resource/js/base.js"></script>
<script type="text/javascript" src="/resource/js/admin/dataitemedit.js"></script>
</head>
<body>
	<div class="position"><span>您的当前位置：</span>网站维护 > <a href="../datamodel/">数据模型管理</a> > <a href="./?datamodelid=${datamodelid}">数据项管理</a> > ${(dataitem.id == 0)?string("新建","修改")}数据项</div>
	<form method="post" action="editdo" onsubmit="return checkform()">
		<div class="rightbody m">
			<div class="rightbodycontent">
				<table cellspacing="1" cellpadding="4" class="tableedit">
					<tr>
						<td>数据项名称：</td>
						<td>
							<input type="text" name="name" id="name" value="${dataitem.name!}" /> <span style="color:red">*</span>
						</td>
					</tr>
		            <tr>
						<td>数据变量名：</td>
						<td>
							<input type="text" name="dataname" id="dataname" value="${dataitem.dataname!}" /> <span style="color:red">*</span>
						    请使用英文字母，该名称将与模板文件里代码对应。
						</td>
					</tr>
					<tr>
						<td>数据数量：</td>
						<td>
							<input type="text" name="datacount" id="datacount" value="${dataitem.datacount!}" /> <span style="color:red">*</span>
						</td>
					</tr>
					<tr>
						<td>引用栏目：</td>
						<td>
							动态栏目：
							<label><input type="checkbox" name="dynamiccolumns"<#if dataitem.dynamiccolumns> checked</#if> class="cbcolumns" onclick="columnsdongtai()" />来自所属的关联栏目</label><br />
							静态栏目：
							<#assign colfirst=true>
                            <#list columnses as columns>
                                <#if !colfirst && columns.parentId == 0><br/><span style='visibility:hidden'>　　　　　</span></#if>
                                <#if columns.parentId == 0><b></#if>
                                <label<#if columns.columnsType.id != 1> onclick="alert('非文档列表类型栏目不可选择')"</#if>><input type="checkbox"<#if columns.columnsType.id == 1> name="columnsids" value="${columns.id}"</#if><#if columnsids?seq_contains(columns.id)> checked</#if><#if columns.columnsType.id != 1> disabled</#if> class="cbcolumns" onclick="columnsjingtai()" />${columns.name}</label>
                                <#if columns.parentId == 0></b></#if>
                                <#assign colfirst=false>
                            </#list>
                            <#if zhuantis?size gt 0>
                                <#list zhuantis as zhuanti>
                                    <br /><span style='visibility:hidden'>　　　 　 　</span><b>${zhuanti.name}：</b>
                                    <#list columnsForZhuanties as columns>
                                    	<#if columns.zhuanti.id == zhuanti.id>
                                        	<label><input type="checkbox" name="columnsids" value="${columns.id}"<#if columnsids?seq_contains(columns.id)> checked</#if> class="cbcolumns" onclick="columnsjingtai()" />${columns.name}</label>
                                        </#if>
                                    </#list>
                                </#list>
                            </#if>
						</td>
					</tr>
					<tr>
						<td>排序条件：</td>
						<td>
						    第一条件：
						    <select name="sortfieldid1">
						    	<#list datasortfields as dsfield>
						    		<option value="${dsfield.id}"<#if dataitem.datasortfield1?? && dsfield.id == dataitem.datasortfield1.id> selected</#if> >${dsfield.name}</option>
						    	</#list>
					        </select>
					        <label><input type="radio" name="sortmethodid1" value="1"<#if !dataitem.datasortmethod1?? || dataitem.datasortmethod1.id != 2> checked</#if> />降序</label><label><input type="radio" name="sortmethodid1" value="2"<#if dataitem.datasortmethod1?? && dataitem.datasortmethod1.id == 2> checked</#if> />升序</label>
						    <br />
						    第二条件：
						    <select name="sortfieldid2">
						    	<#list datasortfields as dsfield>
						    		<option value="${dsfield.id}"<#if dataitem.datasortfield2?? && dsfield.id == dataitem.datasortfield2.id> selected</#if> >${dsfield.name}</option>
						    	</#list>
					        </select>
					        <label><input type="radio" name="sortmethodid2" value="1"<#if !dataitem.datasortmethod2?? || dataitem.datasortmethod2.id != 2> checked</#if> />降序</label><label><input type="radio" name="sortmethodid2" value="2"<#if dataitem.datasortmethod2?? && dataitem.datasortmethod2.id == 2> checked</#if> />升序</label>
						    <br />
						    第三条件：
						    <select name="sortfieldid3">
						    	<#list datasortfields as dsfield>
						    		<option value="${dsfield.id}"<#if dataitem.datasortfield3?? && dsfield.id == dataitem.datasortfield3.id> selected</#if> >${dsfield.name}</option>
						    	</#list>
					        </select>
					        <label><input type="radio" name="sortmethodid3" value="1"<#if !dataitem.datasortmethod3?? || dataitem.datasortmethod3.id != 2> checked</#if> />降序</label><label><input type="radio" name="sortmethodid3" value="2"<#if dataitem.datasortmethod3?? && dataitem.datasortmethod3.id == 2> checked</#if> />升序</label>
						    <br />
					</tr>
					<tr>
		        		<td>部门筛选：</td>
				        <td>
				        	<#list departments as department>
				        		<label><input type="checkbox" name="departmentids" value="${department.id}"<#if departmentids?seq_contains(department.id)> checked</#if>/>${department.name}</label>
				        	</#list>
				        </td>
			        </tr>
					<tr>
						<td>日期限制：</td>
						<td>
							<input type="text" name="dateastrict" id="dateastrict" value="${dataitem.dateastrict}" />日 <span style="color:red">*</span>
							0表示无限制
						</td>
					</tr>
					<tr>
						<td>封面筛选：</td>
						<td>
						    <label><input type="radio" name="haveimage" value="true"<#if !dataitem.haveimage?? || dataitem.haveimage> checked</#if> />是</label>
						    <label><input type="radio" name="haveimage" value="false"<#if dataitem.haveimage?? && !dataitem.haveimage> checked</#if> />否</label>
						    &nbsp;&nbsp;选择“是”将只显示包含封面图片的内容文档，选择“否”则反之。
						</td>
					</tr>
					<tr>
						<td>分页标识：</td>
						<td>
						    <label><input type="radio" name="pagesign" value="true"<#if !dataitem.pagesign?? || dataitem.pagesign> checked</#if> />是</label>
						    <label><input type="radio" name="pagesign" value="false"<#if dataitem.pagesign?? && !dataitem.pagesign> checked</#if> />否</label>
						    &nbsp;&nbsp;选择“是”将会根据该数据项进行分页显示，选择“否”则反之。
						</td>
					</tr>
				</table>
				<input type="hidden" name="dataitemid" value="${dataitem.id}" />
				<input type="hidden" name="datamodelid" value="${datamodelid}" />
			</div>
		</div>
		<div class="rightfoot">
			<div class="rightfootcontent">
				<input type="button" value="返 回" class="return" onclick="history.back()" />&nbsp;
	            <input type="submit" value="保 存" class="save" />
            </div>
        </div>
	</form>
</body>
</html>